package cc.bukkitPlugin.banitem;

import java.util.HashSet;

public class BanItemEnume{

    /**禁止列表查询结果类型*/
    public enum CheckedType{
        SELF,NBT
    }

    public enum OperateType{
        ADD,
        CHECK,
        REMOVE,
        TEST;

        public static OperateType getType(String pName){
            for(OperateType sT : OperateType.values()){
                if(pName.equalsIgnoreCase(sT.name()))
                    return sT;
            }
            return null;
        }

    }

    public enum ListType{
        NBT("NBTCheckList","NBT检查列表",true),
        BAN("BanList","物品黑名单",false),
        USE("NoUseList","物品禁止使用列表",false);

        private String mListName;
        private String mDisplayName;
        private boolean mSimpleNode;

        ListType(String pListName,String pDisplayName,boolean pSimpleNode){
            this.mListName=pListName;
            this.mDisplayName=pDisplayName;
            this.mSimpleNode=pSimpleNode;
        }

        public String getListName(){
            return this.mListName;
        }

        public String getDisplayName(){
            return this.mDisplayName;
        }

        public boolean isSimpleNode(){
            return this.mSimpleNode;
        }

        public static ListType getTypeByEnumeName(String pName){
            for(ListType sT : ListType.values()){
                if(pName.equalsIgnoreCase(sT.name()))
                    return sT;
            }
            return null;
        }

        public static ListType getTypeByListName(String pListName){
            for(ListType sT : ListType.values()){
                if(pListName.equalsIgnoreCase(sT.mListName))
                    return sT;
            }
            return null;
        }

        public static HashSet<ListType> getEnumes(){
            HashSet<ListType> nameList=new HashSet<>(ListType.values().length);
            for(ListType sT : ListType.values()){
                nameList.add(sT);
            }
            return nameList;
        }

    }

}
